<?php
/**
 * 基础配制服务
 *
 * @author		黑冰 <954650386@qq.com>
 */

return [
    'app'       => [
        'directory' => APP_PATH,
    ],
    'db'    => [
        'mysql' => [
            'host'          => 'localhost',
            'user'          => 'root',
            'password'      => 'root',
            'database'      => 'test',
            'port'          => '3306',
            'prefix'        => '',  // 表前缀
            'timeout'       => '10',
            'charset'       => 'utf8',
            'strict_type'   => false, //开启严格模式，query方法返回的数据也将转为强类型
            'fetch_mode'    => true, //开启fetch模式, 可与pdo一样使用fetch/fetchAll逐行或获取全部结果集(4.0版本以上)
        ],
        'redis' => [
            'ip'    => '127.0.0.1',
            'port'  => 6379,
        ],
    ],
    'log'       => [
        'log_level'         => 5,
        'log_path'          => '/data/log',
    ],
    'monitor'   => [
        'log_path'              => '/data/log/monitor',
        'interface_log_path'    => '/interface',
        'count_log_path'        => '/count',
    ],
    'server'    => [
        'ip'            => '0.0.0.0',
        'port'          => 19501,
        'name'          => 'waf',               // 用于进程名称
        'mode'          => SWOOLE_PROCESS,
        'sock_type'     => SWOOLE_SOCK_TCP,     // SWOOLE_SOCK_TCP, SWOOLE_SOCK_UDP
        'setting'       => [
            'worker_num'    => swoole_cpu_num(),  // 默认开启 CPU核数的 Work进程
            'daemonize'     => 1,               // 守护模式
        ],
    ],
    'rpc_server'    => [
        'monitor_server'    =>  [
            'ip'    =>  '127.0.0.1',
            'port'  =>  '50100',
        ],
    ],
    'report_module_key'    => [
        'waf_server_status' => 'waf_server_status',
    ],
];
?>
